﻿using System;
using System.IO;
using System.Xml;
using System.Runtime.Serialization;

namespace SBPweb.PROvibe.Shared.Actors
{

    public interface IEntryInitializationParameter
    {

        [DataMember]
        object Value
        {
            get;
            set;
        }

        //public static string Serialize(EntryInitializationParameter parameter)
        //{
        //    DataContractSerializer dcs = new DataContractSerializer(typeof(EntryInitializationParameter));
        //    XmlWriter xW = XmlWriter.Create(new StringWriter());

        //    dcs.WriteObject(xW, parameter);
        //    return xW.ToString();
        //}

        //public static string Serialize(EntryInitializationParameter parameter)
        //{
        //    XmlFormatter xf = new XmlFormatter();
        //    TextWriter tw = new StringWriter();
        //    xf.Serialize(tw, parameter);

        //    return tw.ToString();
        //}

        //public static EntryInitializationParameter Deserialize(string serialized)
        //{
        //    XmlFormatter xf = new XmlFormatter();
        //    TextReader tr = new StringReader(serialized);

        //    return (EntryInitializationParameter)xf.Deserialize(tr);
        //}

    }

    //[Serializable]
    public interface IEntryInitializationParameter<TValue> : IEntryInitializationParameter
    {

        new TValue Value
        {
            get;
            set;
        }

    }

}